package bz.yfw.example.s3blazeds.part1.validator
{
	import bz.yfw.example.s3blazeds.part1.view.TopView;
	
	import mx.validators.StringValidator;
	import mx.validators.Validator;

	public class TopValidator
	{
		public var view:TopView;
		
		public var validators:Array;
		
		public var inputTextValidator:StringValidator;
		
		public function init():void {
			inputTextValidator = new StringValidator();
			inputTextValidator.source = view.txtinptText;
			inputTextValidator.property = "text";
			inputTextValidator.required = true;
			
			validators = [inputTextValidator];
		}
		
		public function validate():Boolean {
			return Validator.validateAll(validators).length == 0;
		}
	}
}